<div class="grid_3 alpha"><input id="create" value="Crear Campo" type="button" onclick="window.location = '/campos/edit/0';"/></div>
<div class="grid_6 omega" style="text-align:right;">
    <?php echo $paginator->prev()." ["; ?>
    <?php echo $paginator->numbers(); ?>
    <?php echo "] ".$paginator->next(); ?>
    <?php echo "&nbsp;&nbsp;[".$paginator->counter()."]"; ?>
</div>
<div class="clear"></div>


<?php echo $this->Form->create('Campos', array(
                                        'url'           => array('controller' => 'campos', 'action' => 'index'),
                                        'inputDefaults' => array('label' => false, 'div' => false)
                                        )
                                ); ?>
    Filtrar por: <input type='text' name='filtro' value='<?php echo $filtro;?>' style='width:200px;height:24px;margin:4px;'>
    <input type='submit' value='Filtrar'>    
    <?php if (!empty($filtro)) {?>
        <input id="limpiar" value="Limpiar Filtro" type="button" onclick="window.location = '/campos/limpiar_filtro';"/>
    <?php } ?>
    
</form>



<?php echo $this->Form->create('Campos', array('url' => array('controller' => 'campos', 'action' => 'delete'),'inputDefaults' => array('label' => false, 'div' => false))); ?>
    <br />
    <table width="100%">
        <thead>
            <tr>
                <th width="30">Select</th>
                <th width="20"><?php echo $this->Paginator->sort('id');?></th>
                <th><?php echo $this->Paginator->sort('label');?></th>
                <th>Tipo Campo</th>
                <th>Modelo Formulario</th>
            </tr>
        </thead>
        <tbody>
        
    	<?php $i = 0;
    	foreach ($campos as $campo):
    	?>
            <tr>
                <td><input name="data[Delete][<?php echo $campo['Campo']['id'];?>]" value="1" id="Delete<?php echo $campo['Campo']['id'];?>" type="checkbox"/></td>
                <td><?php echo $campo['Campo']['id']; ?>&nbsp;</td>
                <td>
                    <?php echo $this->Html->link($campo['Campo']['label'],
                                array('controller' => 'campos', 'action' => 'edit/'.$campo['Campo']['id'])); ?> 
                </td>                
                <td><?php echo $campo['Typecampo']['name']; ?>&nbsp;</td>
                <td><?php echo $campo['Modeloformulario']['name']; ?>&nbsp;</td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
    
<br />    
<div class="clear"></div>

<div class="grid_3 alpha"><input name="delete" id="delete" value="Eliminar Seleccionados" type="submit" onclick="return confirm('Est&aacute; seguro de eliminar esos registros?');"/></div>
<div class="grid_6 omega" style="text-align:right;">
    <?php echo $paginator->prev()." ["; ?>
    <?php echo $paginator->numbers(); ?>
    <?php echo "] ".$paginator->next(); ?>
    <?php echo "&nbsp;&nbsp;[".$paginator->counter()."]"; ?>
</div>
<div class="clear"></div>
<br />
<div class="grid_3 alpha"><input id="create" value="Crear Campo" type="button" onclick="window.location = '/campos/edit/0';"/></div>
<div class="clear"></div>
    
</form>